Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

jupiter-node-sdk

Package Overview
Dependencies
Maintainers
2
Versions
20
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

jupiter-node-sdk

A thin wrapper around the Jupiter blockchain APIs.

  • 0.2.1
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
3
Maintainers
2
Weekly downloads
 
Created
Source

jupiter-node-sdk

A thin wrapper over the Jupiter blockchain API with some utility functions to make doing common tasks like fetching data and encrypting/decrypting data easy.

Install

$ npm install -s jupiter-node-sdk

Usage

import JupiterClient from 'jupiter-node-sdk'

const client = JupiterClient({
  server: `https://jpr.gojupiter.tech`,
  address: `JUP-XXX-XXX`,
  passphrase: `your secret phrase here`,
  encryptSecret: `optional alphanumeric password to encrypt data going to blockchain`, // DEFAULT: passphrase
})

const jupAmount = client.nqtToJup(stringOfNqtAmount)

const nqtAmount = client.jupToNqt(stringOfJupAmount)

const cipherText = await client.encrypt(
  `plain text to encrypt with AES-256 bit encryption`
)
const plainDecryptedText = await client.decrypt(`cipher text`)

// secretPhrase is basically ERC-20 mnemonic that you can build yourself
const {
  address,
  publicKey,
  requestProcessingTime,
  account,
} = await client.createNewAddress(secretPhrase)

const balanceJup = await client.getBalance(`JUP-XXX-XXX`)

// sender is address in constructor above
await client.sendMoney(recipientJupAddress, amountJupToSend)

// store any data you want (object should be a Javascript object) on the blockchain
await client.storeRecord(object)

// gets all confirmed AND unconfirmed transactions
const txns = await client.getAllTransactions()

// to make any generic Jupiter/NXT API request you can use #request as shown below
// which uses axios under the hood
await client.request('get', '/nxt', {
  params: {
    requestType: 'getBlockchainTransactions',
    account: `JUP-XXX-XXX`,
    withMessage: true,
    type: 1,
  },
})

Keywords

FAQs

Package last updated on 07 Jul 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc